<template>
  <MainLayout>
    <div class="not-found-page">
      <div class="container">
        <div class="not-found-content">
          <div class="not-found-image">
            <el-empty description="页面未找到" />
          </div>
          <h1 class="not-found-title">404</h1>
          <h2 class="not-found-subtitle">页面未找到</h2>
          <p class="not-found-description">抱歉，您访问的页面不存在或已被移除。</p>
          <div class="not-found-actions">
            <router-link to="/" class="btn btn-primary">返回首页</router-link>
            <button class="btn btn-outline" @click="goBack">返回上一页</button>
          </div>
        </div>
      </div>
    </div>
  </MainLayout>
</template>

<script setup>
  import { useRouter } from "vue-router";

  const router = useRouter();

  // 返回上一页
  const goBack = () => {
    router.go(-1);
  };
</script>

<style lang="scss" scoped>
  @import "@/styles/variables.scss";

  .not-found-page {
    padding: $spacing-xxl 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .not-found-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;

    .not-found-image {
      max-width: 300px;
      margin: 0 auto $spacing-xl;

      @media (max-width: $breakpoint-mobile) {
        max-width: 200px;
      }
    }

    .not-found-title {
      font-size: 120px;
      font-weight: bold;
      color: $primary-color;
      line-height: 1;
      margin-bottom: $spacing-md;

      @media (max-width: $breakpoint-mobile) {
        font-size: 80px;
      }
    }

    .not-found-subtitle {
      font-size: $font-size-xxlarge;
      font-weight: bold;
      color: $text-color;
      margin-bottom: $spacing-md;

      @media (max-width: $breakpoint-mobile) {
        font-size: $font-size-xlarge;
      }
    }

    .not-found-description {
      font-size: $font-size-large;
      color: $light-text-color;
      margin-bottom: $spacing-xl;

      @media (max-width: $breakpoint-mobile) {
        font-size: $font-size-base;
      }
    }

    .not-found-actions {
      display: flex;
      justify-content: center;
      gap: $spacing-md;

      @media (max-width: $breakpoint-mobile) {
        flex-direction: column;
        align-items: center;
      }

      .btn {
        @media (max-width: $breakpoint-mobile) {
          width: 100%;
          margin-bottom: $spacing-sm;
        }
      }
    }
  }
</style>
